{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 23 模块函数"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1.【选择】导入模块函数时执行以下哪个代码会产生异常？（ ）  \n",
    "\n",
    "A.`import time  \n",
    "  time.localtime()`  \n",
    "B.`import time as ti  \n",
    "  ti.localtime() `   \n",
    "C.`import time as ti  \n",
    "  localtime()`   \n",
    "D.`from time import localtime  \n",
    "  localtime()`  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：C"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "2.【判断】定义在（第三方）模块中的函数可以直接调用。（ ）\n",
    "\n",
    "A.√  \n",
    "B.×"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：B"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.【改错】以下代码有误，导致无法正确运行得出结果，请写出正确的代码（ ）  \n",
    "`\n",
    "i=9  \n",
    "import math  \n",
    "sqrt(i)`  \n",
    "\n",
    "输出为：\n",
    "3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：  \n",
    "`\n",
    "i=9  \n",
    "import math  \n",
    "math.sqrt(i)`"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [default]",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
